﻿
using System.Diagnostics;

namespace mvc6.Middlewares
{
    public class MyMiddleware2 : IMiddleware
    {
        public async Task InvokeAsync(HttpContext context, RequestDelegate next)
        {
            var s = new Stopwatch();

            s.Start();

            await next(context);

            s.Stop();

            Console.WriteLine($"耗时:{s.ElapsedMilliseconds}");
        }
    }
}
